package com.alipay.sofa.demo.db.controller.swagger;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import springfox.documentation.builders.ApiInfoBuilder;
import springfox.documentation.builders.PathSelectors;
import springfox.documentation.builders.RequestHandlerSelectors;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;

/**
 * @Author Zhang Da
 * @Date 2020/2/13 16:08
 * @Version 1.0
 */
@Configuration
public class SwaggerConfig {
	
	@Bean
    public Docket createRestApi() {
        return new Docket(DocumentationType.SWAGGER_2).groupName("v1")
                .apiInfo(new ApiInfoBuilder()
                        .title("sofa-db-demo api")
                        .description("sofa-db-demo api")
                        .version("1.0")
                        .build())
                .select()
                .apis(RequestHandlerSelectors.basePackage("com.alipay.sofa.demo.db.controller"))
                .paths(PathSelectors.any())
                .build();
    }


}
